<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title></title>
	<style>
		*{text-align:center};
	</style>
</head>
<body>
	<h1>简易计算器</h1>
	<p>第一个数字:<input type="text" id="shu1"/></p>
	<p>第二个数字:<input type="text" id="shu2"/></p>
	<input type="button" value="+" onclick="fuhao('+')"/>
	<input type="button" value="-" onclick="fuhao('-')"/>
	<input type="button" value="*" onclick="fuhao('*')"/>
	<input type="button" value="/" onclick="fuhao('/')"/>
	<p>计算结果：<span id="jieguo">0</span></p>
</body>
	<script>
		function fuhao(qiuzhi){
			var shu1=Number(document.getElementById('shu1').value);
			var shu2=Number(document.getElementById('shu2').value);
			switch(qiuzhi){
				case '+':
					jieguo.innerText=shu1+shu2;
					break;
				case '-':
					jieguo.innerText=shu1-shu2;
					break;
				case '*':
					jieguo.innerText=shu1*shu2;
					break;
				case '/':
					jieguo.innerText=shu1/shu2;
					break;
			}
		}
	</script>
</html>